module.exports = {

	createExchange(connection, name, options) { //新建一个exchange

		return new Promise((resolve, reject) => {

			connection.exchange(name, options || {}, exchange => {
				resolve(exchange);
			});

		});

	},

	createQueue(connection, name, options) {//新建一个queueu

		return new Promise((resolve, reject) => {

			connection.queue('q2', options || {}, function(queue) {
				resolve(queue);
			});

		});
	}


}